package com.zh.note.huawei.onehundred.相对开音节;

import java.util.Scanner;

/**
 * @Author: zhanghuan
 * @date: 2023/9/1 12:49
 * @description: create it
 */


public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // String input = sc.nextLine();
        String input = "!ekam a ekekac";
        String[] world = input.split(" ");
        solution(world);
    }

    private static void solution(String[] worlds) {
        int count = 0;
        for (int i = 0; i < worlds.length; i++) {
            String world = worlds[i];
            if (world.length() < 4) {
                continue;
            }
            if (!world.matches("[a-z]+")) {
                continue;
            }
            StringBuilder sb = new StringBuilder();
            for (int j = 0; j < world.length(); j++) {
                sb.append(world.charAt(j));
            }
            world = sb.reverse().toString();
            //判断反转后的单词是否是开元音
            String child = "";
            for (int j = 0; j < world.length(); j++) {
                if (j + 4 > world.length()) {
                    break;
                }
                child = world.substring(j, j + 4);
                //第一个是非元音
                if (child.substring(0, 1).matches("[aeiou]")) {
                    continue;
                }
                // 第二个必须是元音
                if (!child.substring(1, 2).matches("[aeiou]")) {
                    continue;
                }
                //第三个是非元音+r
                if (child.substring(2, 3).matches("[aeiour]")) {
                    continue;
                }//第四个是e
                if (child.substring(2, 3).matches("[e]")) {
                    continue;
                }
                count++;
            }
        }
        System.out.println(count);
    }
}
